package com.wmyg.scanninggun.sdk;

import com.alibaba.fastjson.JSON;
import org.junit.Test;

import java.util.ArrayList;

public class SDKsouthtest {

    @Test
    public void firstInstallTest() throws Throwable {
        SmartManager smartManager = ManageBuilder.buildManagerToInstall("south", "Admin", "antifake", "developchannel");
        smartManager.firstInstall(new String[]{""});
    }

    @Test
    public void installTest() throws Throwable {
        SmartManager smartManager = ManageBuilder.buildManagerToInstall("south", "Admin", "antifake", "developchannel");
        smartManager.install(new String[]{"init","1"});
    }

    @Test
    public void invokeTest() throws Throwable {
        ArrayList<String> items = new ArrayList<>();
        items.add("I1");
        items.add("I2");
        items.add("I3");
        String list = JSON.toJSONString(items);
        System.out.println(list);
        String[] args = new String[]{"(01)00000000000110(10)EB7979(21)D20181011ldKjvc", "beijing", "2018-01-01 00:00:00"};
        SmartManager smartManager = ManageBuilder.buildManagerToUse("south", "User1", "antifake", "developchannel");
        smartManager.invoke("queryByQR", args);
    }

    @Test
    public void queryTest() throws Throwable {
        SmartManager smartManager = ManageBuilder.buildManagerToUse("south", "User1", "antifake", "developchannel");
        System.out.println(smartManager.query("dataPrepare", new String[]{"(01)06933684005129(10)IPO798(21)X181111"}));
    }

}
